﻿/*
 * Yield.h
 *
 */
#ifndef __GDK_YIELD_H__
#define __GDK_YIELD_H__

#include <gdk/core/Types.h>
#include <gdk/core/Task.h>


namespace gdk
{


#ifdef Yield
#undef Yield
#endif

	class GDK_CORE_EXPORT Yield : public Task
	{
		DECLARE_CLASS_HANDLE(Yield)
		DECLARE_CLASS_INSTANCE(Yield)
		DECLARE_CLASS_INSTANCE1(Yield, uint32_t)

	private:
		uint32_t	_sleepTime;


	protected:
		__INLINE__ Yield(uint32_t sleepTime = 1)
			: _sleepTime(sleepTime)
		{}

	public:
		virtual void onTick(uint32_t timeSinceLastTick);
	};



}//namespace gdk


#endif /*__GDK_YIELD_H__*/
